package com.chen.time.triggers;

public class TimingTriggerEvent extends TriggerEvent {

    public static final TimingTriggerEvent START = new TimingTriggerEvent("Start");
    public static final TimingTriggerEvent STOP = new TimingTriggerEvent("Stop");
    public static final TimingTriggerEvent REPEAT = new TimingTriggerEvent("Repeat");

    private TimingTriggerEvent(String name) {
        super(name);
    }

    @Override
    public TriggerEvent getOppositeEvent() {
        if (this.equals(TimingTriggerEvent.START)) {
            return TimingTriggerEvent.STOP;
        } else if (this.equals(TimingTriggerEvent.STOP)) {
            return TimingTriggerEvent.START;
        }
        return this;
    }
}
